home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 5 Developer's Kit / vb5 dev kit.iso / dev / ct_ocx / ct_gauge.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-01-01  |  9.8 KB  |  318 lines

  1. VERSION 4.00
  2. Begin VB.Form w_gauge_demo 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "ctGauge and ctMeter (Gauge and Status Meter) Demo"
  5.    ClientHeight    =   5670
  6.    ClientLeft      =   1335
  7.    ClientTop       =   1815
  8.    ClientWidth     =   7140
  9.    Height          =   6075
  10.    Icon            =   "ct_gauge.frx":0000
  11.    Left            =   1275
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MDIChild        =   -1  'True
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   5670
  17.    ScaleWidth      =   7140
  18.    Top             =   1470
  19.    Width           =   7260
  20.    Begin VB.CheckBox ck_display 
  21.       Caption         =   "Display Text ( Meters Only )"
  22.       Height          =   285
  23.       Left            =   4020
  24.       TabIndex        =   12
  25.       Top             =   3780
  26.       Value           =   1  'Checked
  27.       Width           =   2835
  28.    End
  29.    Begin VB.Frame Frame2 
  30.       Caption         =   "Border Types"
  31.       BeginProperty Font 
  32.          name            =   "MS Sans Serif"
  33.          charset         =   0
  34.          weight          =   700
  35.          size            =   8.25
  36.          underline       =   0   'False
  37.          italic          =   0   'False
  38.          strikethrough   =   0   'False
  39.       EndProperty
  40.       Height          =   1365
  41.       Left            =   1020
  42.       TabIndex        =   11
  43.       Top             =   4050
  44.       Width           =   2655
  45.       Begin VB.OptionButton opt_style 
  46.          Caption         =   "Inset"
  47.          Height          =   285
  48.          Index           =   5
  49.          Left            =   1260
  50.          TabIndex        =   18
  51.          Top             =   990
  52.          Width           =   1095
  53.       End
  54.       Begin VB.OptionButton opt_style 
  55.          Caption         =   "Drop Shadow"
  56.          Height          =   285
  57.          Index           =   4
  58.          Left            =   1260
  59.          TabIndex        =   17
  60.          Top             =   630
  61.          Width           =   1335
  62.       End
  63.       Begin VB.OptionButton opt_style 
  64.          Caption         =   "Lowered"
  65.          Height          =   285
  66.          Index           =   3
  67.          Left            =   1260
  68.          TabIndex        =   16
  69.          Top             =   270
  70.          Width           =   975
  71.       End
  72.       Begin VB.OptionButton opt_style 
  73.          Caption         =   "Raised"
  74.          Height          =   285
  75.          Index           =   2
  76.          Left            =   180
  77.          TabIndex        =   15
  78.          Top             =   990
  79.          Value           =   -1  'True
  80.          Width           =   975
  81.       End
  82.       Begin VB.OptionButton opt_style 
  83.          Caption         =   "None"
  84.          Height          =   285
  85.          Index           =   1
  86.          Left            =   180
  87.          TabIndex        =   14
  88.          Top             =   630
  89.          Width           =   975
  90.       End
  91.       Begin VB.OptionButton opt_style 
  92.          Caption         =   "Regular"
  93.          Height          =   285
  94.          Index           =   0
  95.          Left            =   180
  96.          TabIndex        =   13
  97.          Top             =   270
  98.          Width           =   915
  99.       End
  100.    End
  101.    Begin VB.Frame Frame1 
  102.       Caption         =   "Active Control"
  103.       BeginProperty Font 
  104.          name            =   "MS Sans Serif"
  105.          charset         =   0
  106.          weight          =   700
  107.          size            =   8.25
  108.          underline       =   0   'False
  109.          italic          =   0   'False
  110.          strikethrough   =   0   'False
  111.       EndProperty
  112.       Height          =   1365
  113.       Left            =   1020
  114.       TabIndex        =   5
  115.       Top             =   1620
  116.       Width           =   2475
  117.       Begin VB.OptionButton opt_gauge 
  118.          Caption         =   "Gauge Control"
  119.          Height          =   285
  120.          Left            =   240
  121.          TabIndex        =   9
  122.          Top             =   990
  123.          Width           =   1935
  124.       End
  125.       Begin VB.OptionButton opt_vert 
  126.          Caption         =   "Vertical Meter"
  127.          Height          =   285
  128.          Left            =   240
  129.          TabIndex        =   8
  130.          Top             =   630
  131.          Width           =   1995
  132.       End
  133.       Begin VB.OptionButton opt_horz 
  134.          Caption         =   "Horizontal Meter"
  135.          Height          =   285
  136.          Left            =   240
  137.          TabIndex        =   7
  138.          Top             =   270
  139.          Value           =   -1  'True
  140.          Width           =   1935
  141.       End
  142.    End
  143.    Begin VB.CommandButton Command1 
  144.       Caption         =   "E&xit"
  145.       Height          =   375
  146.       Left            =   5640
  147.       TabIndex        =   4
  148.       Top             =   5130
  149.       Width           =   1215
  150.    End
  151.    Begin VB.HScrollBar HScroll1 
  152.       Height          =   285
  153.       LargeChange     =   5
  154.       Left            =   1020
  155.       Max             =   100
  156.       TabIndex        =   3
  157.       Top             =   3150
  158.       Width           =   2715
  159.    End
  160.    Begin VB.Label Label2 
  161.       Caption         =   "Move scroll bar to adjust the control"
  162.       ForeColor       =   &H00800000&
  163.       Height          =   285
  164.       Left            =   1020
  165.       TabIndex        =   10
  166.       Top             =   3600
  167.       Width           =   2715
  168.    End
  169.    Begin VB.Label Label1 
  170.       Alignment       =   2  'Center
  171.       Caption         =   $"ct_gauge.frx":030A
  172.       Height          =   735
  173.       Left            =   120
  174.       TabIndex        =   6
  175.       Top             =   90
  176.       Width           =   6915
  177.    End
  178.    Begin GaugeLibCtl.ctGauge ctGauge1 
  179.       Height          =   1965
  180.       Left            =   3960
  181.       TabIndex        =   2
  182.       Top             =   1530
  183.       Width           =   2970
  184.       _version        =   65536
  185.       _extentx        =   5238
  186.       _extenty        =   3466
  187.       _stockprops     =   64
  188.       angleend        =   197
  189.       anglestart      =   343
  190.       bordertype      =   2
  191.       needleyoffset   =   14
  192.       picture         =   "ct_gauge.frx":0422
  193.       needlecolor     =   255
  194.    End
  195.    Begin MeterLibCtl.ctMeter ctMeter2 
  196.       Height          =   4455
  197.       Left            =   120
  198.       TabIndex        =   1
  199.       Top             =   990
  200.       Width           =   735
  201.       _version        =   65536
  202.       _extentx        =   1296
  203.       _extenty        =   7858
  204.       _stockprops     =   68
  205.       BeginProperty font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  206.          name            =   "MS Sans Serif"
  207.          charset         =   0
  208.          weight          =   700
  209.          size            =   9.75
  210.          underline       =   0   'False
  211.          italic          =   0   'False
  212.          strikethrough   =   0   'False
  213.       EndProperty
  214.       bordertype      =   3
  215.       meterstyle      =   1
  216.       backcolor       =   14745599
  217.       forecolor       =   49344
  218.    End
  219.    Begin MeterLibCtl.ctMeter ctMeter1 
  220.       Height          =   465
  221.       Left            =   960
  222.       TabIndex        =   0
  223.       Top             =   990
  224.       Width           =   6015
  225.       _version        =   65536
  226.       _extentx        =   10610
  227.       _extenty        =   820
  228.       _stockprops     =   68
  229.       BeginProperty font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  230.          name            =   "Times New Roman"
  231.          charset         =   0
  232.          weight          =   700
  233.          size            =   9.75
  234.          underline       =   0   'False
  235.          italic          =   0   'False
  236.          strikethrough   =   0   'False
  237.       EndProperty
  238.       bordertype      =   2
  239.    End
  240. Attribute VB_Name = "w_gauge_demo"
  241. Attribute VB_Creatable = False
  242. Attribute VB_Exposed = False
  243. Private Sub ck_display_Click()
  244.    If opt_horz.Value = True Then
  245.       ctMeter1.DisplayText = ck_display.Value
  246.    Else
  247.       ctMeter2.DisplayText = ck_display.Value
  248.    End If
  249. End Sub
  250. Private Sub Command1_Click()
  251.    Unload w_gauge_demo
  252. End Sub
  253. Private Sub Form_Load()
  254.    ' Center the window on the screen
  255.    Move (Screen.Width - Width) / 2, (Screen.Height - Height) * 0.15
  256. End Sub
  257. Private Sub HScroll1_Change()
  258.    If opt_horz.Value = True Then
  259.       ctMeter1.Value = HScroll1.Value
  260.    ElseIf opt_vert.Value = True Then
  261.       ctMeter2.Value = HScroll1.Value
  262.    Else
  263.       ctGauge1.Value = HScroll1.Value
  264.    End If
  265. End Sub
  266. Private Sub HScroll1_Scroll()
  267.    If opt_horz.Value = True Then
  268.       ctMeter1.Value = HScroll1.Value
  269.    ElseIf opt_vert.Value = True Then
  270.       ctMeter2.Value = HScroll1.Value
  271.    Else
  272.       ctGauge1.Value = HScroll1.Value
  273.    End If
  274. End Sub
  275. Private Sub opt_gauge_Click()
  276.    ' Set the style buttons
  277.    opt_style(ctGauge1.BorderType) = True
  278.    ' Set the display text button
  279.    ck_display.Enabled = False
  280.    ' Set the scroll bar
  281.    HScroll1.Value = ctGauge1.Value
  282. End Sub
  283. Private Sub opt_horz_Click()
  284.    ' Set the style buttons
  285.    opt_style(ctMeter1.BorderType) = True
  286.    ' Set the Diplay text box
  287.    ck_display.Enabled = True
  288.    If ctMeter1.DisplayText = True Then
  289.       ck_display.Value = 1
  290.    Else
  291.       ck_display.Value = 0
  292.    End If
  293.    ' Set the scroll bar
  294.    HScroll1.Value = ctMeter1.Value
  295. End Sub
  296. Private Sub opt_style_Click(Index As Integer)
  297.    If opt_horz.Value = True Then
  298.       ctMeter1.BorderType = Index
  299.    ElseIf opt_vert.Value = True Then
  300.       ctMeter2.BorderType = Index
  301.    Else
  302.       ctGauge1.BorderType = Index
  303.    End If
  304. End Sub
  305. Private Sub opt_vert_Click()
  306.    ' Set the style buttons
  307.    opt_style(ctMeter2.BorderType) = True
  308.    ' Set the display text button
  309.    ck_display.Enabled = True
  310.    If ctMeter2.DisplayText = True Then
  311.       ck_display.Value = 1
  312.    Else
  313.       ck_display.Value = 0
  314.    End If
  315.    ' Set the scroll bar
  316.    HScroll1.Value = ctMeter2.Value
  317. End Sub
  318.